package com.hm.service;

import com.hm.service.service.OpencvService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;


/**
 * 该接口会在程序启动后被后台调用
 */
@Component
public class CommandTask implements CommandLineRunner {
    private static final Logger logger = LoggerFactory.getLogger(CommandTask.class);

    private final OpencvService opencvService;

    public CommandTask(OpencvService opencvService) {
        this.opencvService = opencvService;
    }

    @Override
    public void run(String... args) throws Exception {
        logger.warn("=======>Application启动完成<=======");
        opencvService.initOpenCV();

    }
}
